# Determine the DirectShow Show API include and library paths. 
# Once done, the following is defined
#  DIRECTSHOW_FOUND 
#  DirectShow_INCLUDE_DIR 
#  DirectShow_LIBRARY 
IF( CMAKE_SYSTEM_NAME MATCHES Windows )

	# The main/root path where DirectShow should be found (this can be the DirectX SDK install path or the Platform SDK)
	SET( DirectShow_SDK_ROOT_PATH "C:/Program Files/Microsoft SDKs/Windows/v7.1" CACHE STRING "The root path of the SDK providing DirectShow (for example: DirectX or Platform SDK)" )
	MESSAGE( ">DirectShow_SDK_ROOT_PATH=${DirectShow_SDK_ROOT_PATH}")
	# Determine the header path
	FIND_PATH( DirectShow_INCLUDE_DIR NAMES DShow.h PATHS "${DirectShow_SDK_ROOT_PATH}/Include" NO_DEFAULT_PATH  )
	MESSAGE( ">DirectShow_INCLUDE_DIR=${DirectShow_INCLUDE_DIR}")
	
	# Determine the library path depending on the architecture (x86 or x64)
	# The structure of Microsoft SDKs (DirectX and Platform) are not the same regarding libs
	# In the DirectX SDK (at least the June 2010 one), libs are stored in two folders: x86 and x64
	# In the Platform SDK, the x86 libs are at the root and x64 in a folder.
	IF ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
		FIND_LIBRARY( DirectShow_LIBRARY NAMES strmiids PATHS "${DirectShow_SDK_ROOT_PATH}/Lib/x64" NO_DEFAULT_PATH )
	ELSE()
		FIND_LIBRARY( DirectShow_LIBRARY NAMES strmiids PATHS "${DirectShow_SDK_ROOT_PATH}/Lib/x86" "${DirectShow_SDK_ROOT_PATH}/Lib" NO_DEFAULT_PATH )
	ENDIF()
	MESSAGE( ">DirectShow_LIBRARY=${DirectShow_LIBRARY}")
		
	INCLUDE( FindPackageHandleStandardArgs )
	FIND_PACKAGE_HANDLE_STANDARD_ARGS( DirectShow DEFAULT_MSG DirectShow_LIBRARY DirectShow_INCLUDE_DIR )

	#FIND_PACKAGE_HANDLE_STANDARD_ARGS( DirectInput DEFAULT_MSG DirectInput_LIB DirectInput_GUID_LIB DirectInput_INCLUDE_DIR )

	
ENDIF()
